package com.controller;

import com.dao.DeviceBoxMapper;
import com.model.DeviceBox;
import com.po.CustomerPO;
import com.po.DeviceBoxModifyPO;
import com.po.DeviceBoxPO;
import com.result.Result;
import com.service.CustomerService;
import com.service.DeviceBoxService;
import com.vo.CustomerVO;
import com.vo.DeviceBoxQueryVO;
import com.vo.DeviceBoxVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @Author: chihaojie
 * @Date: 2019/5/29 14:21
 * @Version 1.0
 * @Note
 */


@Api(value = "deviceBoxApi")
@CrossOrigin
@RestController
@RequestMapping("/deviceBox")
public class DeviceBoxController {


    @Autowired
    private DeviceBoxService deviceBoxService;

    @ApiOperation(value = "修改", httpMethod = "POST", notes = "修改")
    @RequestMapping(value = "/modifyById", method = RequestMethod.POST,produces = "application/json;charset=utf-8")
    public Result<Boolean> modifyById(@RequestBody DeviceBoxModifyPO deviceBoxModifyPO) {
        return deviceBoxService.modifyById(deviceBoxModifyPO);
    }



    @ApiOperation(value = "查询", httpMethod = "POST", notes = "查询")
    @RequestMapping(value = "/queryAll", method = RequestMethod.POST,produces = "application/json;charset=utf-8")
    public Result<List<DeviceBoxQueryVO>> queryAll(@RequestBody DeviceBox deviceBox) {
        return deviceBoxService.queryAll(deviceBox);
    }

    @ApiOperation(value = "查询", httpMethod = "GET", notes = "查询")
    @RequestMapping(value = "/queryById", method = RequestMethod.GET)
    public Result<DeviceBoxQueryVO> queryById(@RequestParam Long id) {
        return deviceBoxService.queryById(id);
    }

}
